Formula |
AND(
OR(ShippingCountry = "USA", ISBLANK(ShippingCountry)),
OR(
AND(LEN(ShippingPostalCode) <>5,
LEN(ShippingPostalCode) <> 10),
NOT(CONTAINS("0123456789",
LEFT( ShippingPostalCode, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 2, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 3, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 4, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 5, 1))),
AND(
LEN(ShippingPostalCode) = 10,
OR(
MID( ShippingPostalCode , 6, 1) <> "-",
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 7, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 8, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 9, 1))),
NOT(CONTAINS("0123456789",
MID( ShippingPostalCode , 10, 1)))
)
)
)
)
|